package com.qs.order.utils;

import java.util.Random;

/**
 * @Desc:  生成orderId
 * @author: jianfeng
 * @Time: 2019/9/17 10:25
 */
public class KeyUtil {


    /**
    * @Desc:  生成唯一的主键，格式：时间+随机数
    * @author: jianfeng
    * @Time: 2019/9/17 10:28
    * @return java.lang.String
    */
    public static synchronized String genUniqueKey(){
        Random random=new Random();
        Integer number=random.nextInt(900000)+100000;

        return System.currentTimeMillis()+String.valueOf(number);
    }

}
